class Animal():
    def __init__(self, name, color, age, sex):
        self.name = name
        self.age = age
        self.color = color
        self.sex = sex

    def run(self):
        print(f"一只名字叫{self.name},年龄为{self.age},颜色为{self.color},性别为{self.color}的小动物在跑")

    def call(self):
        print(f"一只名字叫{self.name},年龄为{self.age},颜色为{self.color},性别为{self.color}的小动物在叫")


class Mao(Animal):
    def __init__(self, name, age, color, sex):
        self.hear = "短毛"
        # 重写父类的__init__方法，继承父类的属性
        super().__init__(name, age, color, sex)
        # 捉老鼠

    def zhuolaoshu(self):
        print(f"一只名字叫{self.name},年龄为{self.age},颜色为{self.color},性别为{self.color},毛发为{self.hear}的小猫会抓老鼠")

    def call(self):
        print(f"一只名字叫{self.name},年龄为{self.age},颜色为{self.color},性别为{self.color}的猫在喵喵叫")


class Dog(Animal):
    def __init__(self, name, age, color, sex):
        self.hear = "长毛"
        super().__init__(name, age, color, sex)

    def kanjia(self):
        print(f"一只名字叫{self.name},年龄为{self.age},颜色为{self.color},性别为{self.sex},毛发为{self.hear}的小狗会看家")

    def call(self):
        print(f"一只名字叫{self.name},年龄为{self.age},颜色为{self.color},性别为{self.sex}的小狗汪汪叫")


if __name__ == '__main__':
    mao = Mao("小花", "黑色", 12, "女")
    mao.zhuolaoshu()

    dog = Dog("小花", "黑色", 12, "女")
    dog.kanjia()
